package zeebe.subprocess;

import io.vertx.core.json.JsonObject;
import io.zeebe.client.ZeebeClient;
import io.zeebe.client.api.response.ActivatedJob;
import io.zeebe.client.api.worker.JobClient;
import io.zeebe.client.api.worker.JobHandler;

public class AAJobWorkerHandler implements JobHandler {
    ZeebeClient zeebeClient;

    public AAJobWorkerHandler(ZeebeClient client) {
        this.zeebeClient = client;
    }

    @Override
    public void handle(JobClient client, ActivatedJob job) throws Exception {
        System.out.println("开始执行AAJobWorker");

        System.out.println("AAjobwoker中 存入参数AA=3");
        JsonObject input=new JsonObject()
                .put("AA",3);
        client.newCompleteCommand(job.getKey())
                .variables(input.encode())
                .send()
                .join();
    }
}
